import request from '@/config/axios'

// 收货地区物流方式 VO
export interface GlobeStateMethodVO {
  id: number // 收货地区id
  log: string // logo
  logisticsMode: string // 物流方式
  directlyStatus: number // 是否直达（0-否 1-是）
}

// 收货地区物流方式 API
export const GlobeStateMethodApi = {
  // 查询收货地区物流方式分页
  getGlobeStateMethodPage: async (params: any) => {
    return await request.get({ url: `/trade/globe-state-method/queryGlobeStateMethodPage`, params })
  },

  getGlobeStateMethodPageOld: async (params: any) => {
    return await request.get({ url: `/trade/globe-state-method/page`, params })
  },
  // 查询收货地区物流方式详情
  getGlobeStateMethod: async (id: number) => {
    return await request.get({ url: `/trade/globe-state-method/get?id=` + id })
  },

  // 新增收货地区物流方式
  createGlobeStateMethod: async (data: GlobeStateMethodVO) => {
    return await request.post({ url: `/trade/globe-state-method/create`, data })
  },

  // 修改收货地区物流方式
  updateGlobeStateMethod: async (data: GlobeStateMethodVO) => {
    return await request.put({ url: `/trade/globe-state-method/update`, data })
  },

  // 删除收货地区物流方式
  deleteGlobeStateMethod: async (id: number) => {
    return await request.delete({ url: `/trade/globe-state-method/delete?id=` + id })
  },

  // 导出收货地区物流方式 Excel
  exportGlobeStateMethod: async (params) => {
    return await request.download({ url: `/trade/globe-state-method/export-excel`, params })
  },
}
